package com.yami.trading.huobi.data.websocket.client;


import com.yami.trading.huobi.data.websocket.client.req.market.SubMarketDepthRequest;
import com.yami.trading.huobi.data.websocket.client.req.market.SubMarketTickerRequest;
import com.yami.trading.huobi.data.websocket.client.req.market.SubMarketTradeRequest;
import com.yami.trading.huobi.data.websocket.constant.Options;
import com.yami.trading.huobi.data.websocket.constant.enums.ExchangeEnum;
import com.yami.trading.huobi.data.websocket.exception.SDKException;
import com.yami.trading.huobi.data.websocket.model.market.MarketDepthEvent;
import com.yami.trading.huobi.data.websocket.model.market.MarketTickerEvent;
import com.yami.trading.huobi.data.websocket.model.market.MarketTradeEvent;
import com.yami.trading.huobi.data.websocket.service.huobi.HuobiMarketService;
import com.yami.trading.huobi.data.websocket.utils.ResponseCallback;

public interface MarketClient {

	void subMarketDepth(SubMarketDepthRequest request, ResponseCallback<MarketDepthEvent> callback);
	
	void subMarketTrade(SubMarketTradeRequest request, ResponseCallback<MarketTradeEvent> callback);
	
	void subMarketTicker(SubMarketTickerRequest request, ResponseCallback<MarketTickerEvent> callback);

	static MarketClient create(Options options) {

		if (options.getExchange().equals(ExchangeEnum.HUOBI)) {
			return new HuobiMarketService(options);
		}
		throw new SDKException(SDKException.INPUT_ERROR, "Unsupport Exchange.");
	}
}
